<?
 $db = new PDO('mysql:host=;dbname=cubes','mysql','p3JAnbt26sdZmars');
 $db->query("SET NAMES 'utf8'");
 $db->query("SET CHARACTER SET 'utf8'");
 $db->query("SET SESSION collation_connection = 'utf8_general_ci'");
 $db->query("SHOW VARIABLES LIKE 'UTF-8'");
 
 try {
 
   foreach ( $db->query('SELECT * FROM `test` ') as $row ) {
	   	print "<pre>";
		print_r($row);
		print "</pre>";
   }
   $db = null;
 } catch (PDOException $e) {
   print "Error!: " . $e->getMessage() . "<br/>";
   die();
 }
 
 
?>